package com.lzy.product.service.impl;

import com.lzy.framework.core.utils.DozerUtils;
import com.lzy.product.dao.ProductSaleConditionMapperExt;
import com.lzy.product.dtos.ProductSaleConditionDto;
import com.lzy.product.entity.ProductSaleCondition;
import com.lzy.product.service.ProductSaleConditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by WIN7 on 2017/12/12.
 */
@Service
public class ProductSaleConditionServiceImpl implements ProductSaleConditionService {

    @Autowired
    ProductSaleConditionMapperExt productSaleConditionMapperExt;

    @Override
    public Long insert(ProductSaleConditionDto dto) {
        return productSaleConditionMapperExt.insertSelective(DozerUtils.map(dto, ProductSaleCondition.class)) > 0L ? 1L : null;
    }

    @Override
    public Boolean update(ProductSaleConditionDto dto) {
        return productSaleConditionMapperExt.updateByPrimaryKeySelective(DozerUtils.map(dto, ProductSaleCondition.class)) > 0;
    }

    @Override
    public Boolean delete(Long id) {
        return null;
    }

    @Override
    public Boolean remove(Long id) {
        return null;
    }

    @Override
    public ProductSaleConditionDto findById(Long id) {
        return null;
    }

    @Override
    public List<ProductSaleConditionDto> query(ProductSaleConditionDto dto) {
        return productSaleConditionMapperExt.selectList(dto);
    }

    @Override
    public Integer deleteByPrimaryKey(ProductSaleConditionDto dto) {
        return productSaleConditionMapperExt.deleteByPrimaryKey(dto);
    }
}
